﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ClassPractice
{
    class Program
    {
        static void Main(string[] args)
        {
            Person firstPerson = new Person();
            firstPerson.firstName = "FirstName1";
            firstPerson.lastName = "LastName1";
            firstPerson.salary = 100;

            Person secondPerson = new Person();
            secondPerson.firstName = "FirstName2";
            secondPerson.lastName = "LastName2";
            secondPerson.salary = 200;

            Person thirdPerson = new Person();
            thirdPerson.firstName = "FirstName3";
            thirdPerson.lastName = "LastName3";
            thirdPerson.salary = 300;

            Person fourthRerson = new Person();
            fourthRerson.firstName = "FirstName4";
            fourthRerson.lastName = "LastName4";
            fourthRerson.salary = 400;

            Person fifthPerson = new Person();
            fifthPerson.firstName = "FirstName5";
            fifthPerson.lastName = "LastName5";
            fifthPerson.salary = 500;

            Person[] employeeArray = new Person[5];
            employeeArray[0] = firstPerson;
            employeeArray[1] = secondPerson;
            employeeArray[2] = thirdPerson;
            employeeArray[3] = fourthRerson;
            employeeArray[4] = fifthPerson;

            int totalSalary = 0;
            foreach (var person in employeeArray)
            {
                person.printEmploees();
                totalSalary += person.salary;
            }
            Console.WriteLine("Summ sallary of employees {0}", totalSalary);

        }
    }
}
